package common.until;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        //在打卡的时候自动给上默认值
        this.setFieldValByName("clock_time",new Date(),metaObject);
        //创建巡店任务给上默认值
        this.setFieldValByName("new_time",new Date(),metaObject);
        this.setFieldValByName("wc",0,metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        
    }
}
